package com.lms.demo.autoconfigure.minio;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Author: 李孟帅
 * @CreateTime: 2020-12-25 11:21
 * @Description:
 */
@ConfigurationProperties(prefix = "lms.minio")
public class MinioProperties {

    private String endpoint;
    private String accessKey;
    private String secretKey;

    public String getEndpoint() {
        return endpoint;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }



    public static Builder builder() {
        return new Builder(new MinioProperties());
    }

    public static final class Builder {

        MinioProperties minioProperties;
        public Builder(MinioProperties minioProperties){
            this.minioProperties = minioProperties;
        }
        public Builder endpoint(String endpoint) {
            minioProperties.endpoint=endpoint;
            return this;
        }

        public Builder accessKey(String accessKey) {
            minioProperties.accessKey=accessKey;
            return this;
        }

        public Builder secretKey(String secretKey) {
            minioProperties.secretKey=secretKey;
            return this;
        }

        public MinioProperties build(){
            return minioProperties;
        }
    }
}
